using System;
using System.Collections.Generic;
using MapperLearing.Mapper_Mine.Dto;
using UtilTools;

namespace MapperLearing.Mapper_Mine
{
    public class MapperMineTestcs
    {
        public void Test001()
        {
            List<ObjStr> list = new List<ObjStr>(){
                new ObjStr(){
                Start = "2021-3-12 14:00:00",
                End= "2021-5-12 14:00:00"
                },
                new ObjStr(){
                Start = null,
                End= "2021-5-12 14:00:00"
                },
                new ObjStr(){
                Start = "2021-3-12 14:00:00",
                End= null
                },
                new ObjStr(){
                Start = null,
                End= null
                },
            };
            //string到Datetime
            List<ObjTime> objTimes = new List<ObjTime>();
            list.ForEach(it => objTimes.Add(new ObjTime().MapperFromWeb(it)));
            PrintHelper.PrintList(objTimes);
            //Datetime到string
            List<ObjStr> objStrs = new List<ObjStr>();
            objTimes.ForEach(it => objStrs.Add(new ObjStr().MapperFromWeb(it)));
            PrintHelper.PrintList(objStrs);
        }
    }
}